#!/bin/sh /etc/rc.common

START=99

start()
{
	upnp_enable=$(uci get UPnP.config.enable)
	if [ ${upnp_enable} = 1 ]; then
		/etc/init.d/miniupnpd enable
		/etc/init.d/miniupnpd start
	fi
}

stop()
{
	upnp_enable=$(uci get UPnP.config.enable)
	if [ ${upnp_enable} = 0 ]; then
		/etc/init.d/miniupnpd stop
		/etc/init.d/miniupnpd disable
	fi
}

restart()
{
	stop
	start
}

